home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / demo / 6809sim / mirror.asm < prev    next >
Encoding:
Assembly Source File  |  1994-06-19  |  537 b   |  26 lines

  1. \ Mirror the string at address $40 and put it at address $80
  2. ASSEMBLE
  3.  
  4. $40 CONSTANT STR1
  5. $80 CONSTANT STR2
  6.  
  7. 0 ORG
  8.  
  9. LDY # STR1
  10. LDB ,Y+       \ Fetch length byte of first string.
  11. STB STR2      \ Store it at address of second string.
  12. LDX # STR2 1+
  13. ABX           \ Add length to strarting addr of string.
  14. TSTB
  15. 0<> IF
  16.  BEGIN
  17.   LDA ,Y+     \ Get byte of string. (increment pointer)
  18.   STA ,-X     \ Store byte into other string. (decrement pointer).
  19.   DECB        \ Decrement length
  20.  0= UNTIL
  21. THEN
  22. JMP $FFFF      \ Jump to breakpoint.
  23.  
  24. ENDASM
  25.  
  26.